﻿using System;
using System.Collections.Generic;

using Styx;

namespace Example
{
    public class MessageEventArgs : UserInfoEventArgs
    {
        private string _message;

        public MessageEventArgs()
        {
            _message = "";
        }

        public MessageEventArgs(string userName, string message) : base(userName)
        {
            _message = message;
        }

        public string Message
        {
            get { return _message; }
        }

        public override void FromStream(System.IO.Stream stream)
        {
            base.FromStream(stream);
            _message = Serialize.ValueFromStream<string>(stream);
        }

        public override void ToStream(System.IO.Stream stream)
        {
            base.ToStream(stream);
            Serialize.ValueToStream<string>(stream, _message);
        }
    }
}
